package com.lut.reservation.controller;

import com.lut.reservation.bean.Result;
import com.lut.reservation.bean.RoomComment;
import com.lut.reservation.service.RoomCommentService;
import com.lut.reservation.util.ResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zyt
 */
@Slf4j
@RestController
@RequestMapping("/api/room/comment")
public class RoomCommentController extends BaseController<RoomCommentService, RoomComment> {
  @PostMapping("/refuse/{id}")
  public Result<Void> refuse(@PathVariable Integer id) {
    service.updateState(id, "REFUSE");
    return ResultUtil.success();
  }

  @PostMapping("/pass/{id}")
  public Result<Void> pass(@PathVariable Integer id) {
    service.updateState(id, "PASS");
    return ResultUtil.success();
  }
}
